<template>
  <div style="margin:30px">
    <el-button type="info" style="margin-left:84%" @click="back">返回</el-button>
    <el-button v-print="'#printTest'" type="success">打印</el-button>
    <div id="printTest">
      <p class="font">客户报价单管理</p>
      <table>
        <tr>
          <!-- <td>编码</td>
          <td>客户简称</td> -->
          <td>客户名称</td>
          <td>纸板名称</td>
          <td>箱型</td>
          <td>销售平方价(元)</td>
          <td>箱型计价</td>
          <td>总价(元)</td>
        </tr>
        <tr v-for="item in tableData" :key="item.id">
          <!-- <td>{{ item.code }}</td>
          <td>{{ item.shorts }}</td> -->
          <td>{{ item.fullName }}</td>
          <td>{{ item.paperName }}</td>
          <td>{{ item.boxType }}</td>
          <td>{{ item.squaredPrice }}</td>
          <td>{{ item.boxPrice }}</td>
          <td>{{ item.totalPrice }}</td>
        </tr>
      </table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      flag: '',
      id: '',
      tableData: [],
      addDialog: {
        show: false
      },
      total: 0,
      form: {
        page: 1,
        count: 10,
        limitPaperLength: false
      },
      disable: false

    }
  },
  created() {
    var list2 = []
    var object = this.$route.query
    for (const key in object) {
      if (object.hasOwnProperty(key)) {
        const element = object[key]
        list2.push(element)
      }
    }
    this.tableData = list2
    // this.tableData.forEach(x => {

    // })
    console.log(this.tableData)
    // console.log(this.tableData[0].boxType[0])
  },
  methods: {
    back() {
      this.$router.push('/customerquotation')
    }
  }

}
</script>

<style scoped>
.font{
  font-weight: bold;
  width:400px;
  height: 100px;
  line-height: 100px;
  font-size: 30px;
  font-family: 'Courier New', Courier, monospace;
  /* text-align: center; */
  margin-left: 40%;
  margin-bottom: 0%;
}
table,tr,td{
  border:1px solid black;
}
table{
  border-collapse:collapse;
  height: auto;
  width:1050px;
  margin: 0 auto;
  /* margin-top: -20px */
}
tr{
  height: 35px;
}
table td{
  height: 35px;
}
td{
  width: 180px;
  text-align: center ;
  padding-left:15px;
}
</style>
